{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
 <link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/front_css/orders.css?version={$version}"> 
<style type="text/css">
	body{
			padding-top:2.2rem;
		}
</style>
{/block}
{block name="content"}
{include file="../common_header.html"}
	<!--大图-->
	<img src="{$incubator_info.pic}" alt="" class="detail_banner" />
	<div class="orders_pro_info">
		<h1 class="title">{$incubator_info.incubator_name}</h1>

		<!--众创空间    确认订单-->
		<ul class="pro_info_list">
			<li class="clearfix address">
				<span class="fl">地址</span>
				<a href="" class="fl address_word">
					{$incubator_info.address}
				</a>
				<a href="" class="fl address_icon"></a>
			</li>
			<li class="clearfix" style="display:flex;align-items:center;">
				<span class="fl">联系方式</span>
				<a href="tel:{$incubator_info.tel}" class="fl phone">
					{$incubator_info.tel}&nbsp;&nbsp;
				</a>
				<a href="tel:" class="fl phone_icon"></a>
			</li>
		</ul>
		<!--简介-->
		<div class="pro_intro">
			<!--数据嵌套时，div内部标签都要删了-->
			<p>
				{$incubator_info.describe}
			</p>
			<!--<img src="/Public/Images/front/front_img/service_fws_pic3x.png" />-->
			<!--<p>西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号西湖区益乐路223号</p>-->
		</div>
		<div class="shrink-btn">
			<span>展开空间简介</span>
			&nbsp;
			<i class="icon icon_zhankai_default3x"></i>
		</div>
		<div class="spread-btn" style="display:none;">
			<span>收缩空间简介</span>
			&nbsp;
			<i class="icon icon_shousuo_default3x"></i>
		</div>
	</div>
	<!--订单的客户信息-->
	<!--众创空间-->
	<ul class="user_orders_intro zhongchuang">
		<li class="clearfix mg-top0">
			<span class="fl">订单编号</span>
			<i class="fl">:</i>
			<p class="fl">{$incubator_order_info.order_sn}</p>
		</li>
		<li class="clearfix">
			<span class="fl">公司/项目名称</span>
			<i class="fl">:</i>
			<p class="fl">{$incubator_order_info.company_name}</p>
		</li>
		<li class="clearfix">
			<span class="fl">联系人姓名</span>
			<i class="fl">:</i>
			<p class="fl">{$incubator_order_info.contacts}</p>
		</li>
		<li class="clearfix">
			<span class="fl">联系人电话</span>
			<i class="fl">:</i>
			<a href="tel:{$incubator_order_info.contact_number}" class="fl phone">
				{$incubator_order_info.contact_number}
			</a>
		</li>
		<li class="clearfix">
			<span class="fl">入驻天数</span>
			<i class="fl">:</i>
			<p class="fl">{$incubator_order_info.day_num}</p>
		</li>
		<li class="clearfix">
			<span class="fl">工位数量</span>
			<i class="fl">:</i>
			<p class="fl">{$incubator_order_info.station_num}</p>
		</li>
	</ul>
{if $incubator_order_info.pay_status == 0}
	<!--支付方式-->
	<div class="pay_method">
		<h6 class="pay_title">支付方式</h6>
		<div class="pay_wrap">
			<div class="ali_pay pay" data-payway="ali_pay">
				<span class="pay_icon"></span>
				<span>支付宝支付</span>
				<span class="circle_icon"></span>
			</div>
			<div class="weixin_pay pay" data-payway="wx_pay">
				<span class="pay_icon"></span>
				<span>微信支付</span>
				<span class="circle_icon selected"></span>
			</div>
		</div>
	</div>
{/if}
	<!--商品金额-->
	<div class="orders_price">
		<span>商品金额</span>
		<span class="price_val">¥{$incubator_order_info.total_amount}</span>
	</div>
{if $incubator_order_info.pay_status == 0}
	<!--提交订单-->
	<div class="orders_detail_foot">
		<p class="actual_pay">
			<span>实付：</span>
			<span class="actual_pay_val">¥{$incubator_order_info.total_amount}</span>
		</p>
		{if $incubator_order_info.order_status == 1}
		<a href="javascript:;" class="order_submit pay_submit">提交订单</a>
		{else}
		<a href="javascript:;" class="order_submit" style="background-color: #000000">待审核</a>
		{/if}
	</div>
{/if}
{/block}
{block name="js"}

<script type="text/javascript">
	var payway = 'wx_pay';
	var order_id = parseInt('{$order_id}');
	var jsApiParameters = '';
	{literal}
	//简介的展开与收缩
	var firstChild = $(".pro_intro")[0].children[0].nodeName;
	var rem = parseInt($("body").css("fontSize"));
	var lineNum;
	if(firstChild=="P"){
		var hei = $(".pro_intro p").eq(0).height();
		lineNum = hei/rem;
		if(lineNum>3){
			$(".shrink-btn").css("display","flex");
			$(".pro_intro p").eq(0).addClass("slice_word");
			hei = $(".pro_intro p").eq(0).height();
			$(".pro_intro").css({
				"height":hei + "px",
				"overflow":"hidden"
			});
			$(".shrink-btn").on("click",function(){
				$(".pro_intro p").eq(0).removeClass("slice_word");
				$(".shrink-btn").css("display","none");
				$(".spread-btn").css("display","flex");
				$(".pro_intro").css({
					"height":"auto",
					"overflow":"hidden"
				});
			})
			$(".spread-btn").on("click",function(){
				$(".pro_intro p").eq(0).addClass("slice_word");
				hei = $(".pro_intro p").eq(0).height();
				$(".shrink-btn").css("display","flex");
				$(".spread-btn").css("display","none");
				$(".pro_intro").css({
					"height":hei + "px",
					"overflow":"hidden"
				});
			})
		}else{
			$(".shrink-btn").css("display","none");
		}
	}else{
		var hei = $(".pro_intro img").eq(0).height();
		$(".pro_intro").css({
			"height":hei + "px",
			"overflow":"hidden"
		});
		$(".shrink-btn").on("click",function(){
			$(".shrink-btn").css("display","none");
			$(".spread-btn").css("display","flex");
			$(".pro_intro").css({
				"height":"auto",
				"overflow":"hidden"
			});
		});
		$(".spread-btn").on("click",function(){
			$(".shrink-btn").css("display","flex");
			$(".spread-btn").css("display","none");
			$(".pro_intro").css({
				"height":hei + "px",
				"overflow":"hidden"
			});
		});
	}
	//选择支付方式
	$(".pay_method .pay").on("click",function(){
		payway = $(this).data('payway');
		$(this).children(".circle_icon ").addClass("selected");
		$(this).siblings().children(".circle_icon ").removeClass("selected");
	});


	$('.pay_submit').on('click', function(){
		$.ajax({
			url:'/FrontIncubator/payment',
			type:'post',
			data:{order_id:order_id, payway:payway},
			success:function(r){
				console.log(r);
				if(r.code == 0){
					native_listen(payway,{
					    parameter : r.parameter,
					});
				}else{
					layer.open({
		                content: '支付失败',
		                title: false,
		                btn: ['确定'],
		            });
				}
			}
		})
	})
	{/literal}
</script>

{/block}
